home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / tex / sed15.zip / HISTORY.ZIP / SED.SMA < prev    next >
Text File  |  1991-09-24  |  43KB  |  1,084 lines

  1. 
  2. Date: Fri, 21 Jun 91 14:07:05 CDT
  3. From: robin@utafll.uta.edu (Robin Cover)
  4. Message-Id: <9106212107.AA17356@utafll.uta.edu>
  5. To: kirsch@usasoc.soc.mil
  6. Subject: sed11
  7. Cc: robin@utafll.uta.edu
  8.  
  9. Thanks to Eric Raymond and others who contributed to the 18K sed exec.
  10.  
  11. I have a couple questions - which might be as easily answered as having
  12. a BSD UNIX manual (but I don't).
  13.  
  14. Scripts which worked with the GNUish sed don't work with the current
  15. sed, namely, in the treatment of <CR> and <LF>.  With the GNUish
  16. version, one may enter OD OA (<CR><LF>) directly into a script and
  17. get results; your current 18K version seems to accept the notation
  18.  \d13\d10  as equivalent to <CR><LF>, but I do not see this in the
  19. man page.  In fact, it has never been clear to me why the GNUish
  20. utils for DOS do not (always?) predictably improve on the handling
  21. of the 8th bit.  Much of my text processing requires that I am
  22. able to address control chars (0-31), hi-bit chars -- in a word,
  23. all chars that wordprocessors reserve for their private purposes.
  24. Standard UNIX is very unreliable in (usually NOT) allowing one to
  25. address the full 8-bit ascii char set except for minor instances
  26. of generosity, so I look to the DOS UNIX-lookalikes to solve the
  27. problem.
  28.  
  29. Questions:
  30.  
  31. 1) are decimal 10 and 13 the ONLY chars that can be addressed with "sed11"
  32.    using the convention \d13  ?
  33. 2) otherwise, will "sed11" faithfully handle all 256 chars, if they are
  34.    in scripts and text files?
  35. 3) is it not reasonable to think of pushing the buffer size beyond
  36.    4K (e.g., for the purpose of using tags in the pattern space)?  The
  37.    major drawback of these utils is that they choke on long lines --
  38.    I am thinking of SGML files, for instance.  Do you know of any
  39.    attempts (for 386 machines) to build grep/sed/awk to handle
  40.    LONG lines - approaching 32K, or more?
  41.  
  42. Thanks,
  43.  
  44. Robin Cover
  45.  
  46. -----------------------------------------------------------------------------
  47. Robin Cover                BITNET:   zrcc1001@smuvm1     ("one-zero-zero-one")
  48. 6634 Sarah Drive           Internet: robin@utafll.uta.edu     ("uta-ef-el-el")
  49. Dallas, TX  75236  USA     Internet: zrcc1001@vm.cis.smu.edu
  50. Tel: (1 214) 296-1783      Internet: robin@ling.uta.edu
  51. FAX: (1 214) 841-3642      Internet: robin@txsil.sil.org
  52. =============================================================================
  53.  
  54. 
  55. 
  56. Date:     Sat, 22 Jun 91 16:14:58 EDT
  57. From:     David Kirschbaum
  58. To:       robin@utafll.uta.edu (Robin Cover)
  59. Subject:  Re:  sed11
  60.  
  61. >Scripts which worked with the GNUish sed don't work with the current
  62. >sed, namely, in the treatment of <CR> and <LF>.  With the GNUish
  63. >version, one may enter OD OA (<CR><LF>) directly into a script and
  64. >get results; your current 18K version seems to accept the notation
  65. > \d13\d10  as equivalent to <CR><LF>, but I do not see this in the
  66. >man page.
  67.  
  68. I believe these instructions (from the sed11.man) apply to all commands:
  69.  
  70. l               (2)
  71.    List. Sends the pattern space to standard output.  A "w" option may follow as in the s command below. Non-printable characters expand to:
  72.    \b  --  backspace (ASCII 08)
  73.    \t  --  tab       (ASCII 09)
  74.    \n  --  newline   (ASCII 10)
  75.    \r  --  return    (ASCII 13)
  76.    \e  --  escape    (ASCII 27)
  77.    \xx --  the ASCII character corresponding to 2 hex digits xx.
  78.  
  79. Your CR or 0DH would be \0D  and your LF would be \0A.  Similar to, but
  80. simpler than, C's \0x0d and \0x0a.
  81.  
  82. >      In fact, it has never been clear to me why the GNUish
  83. >utils for DOS do not (always?) predictably improve on the handling
  84. >of the 8th bit.  Much of my text processing requires that I am
  85. >able to address control chars (0-31), hi-bit chars -- in a word,
  86. >all chars that wordprocessors reserve for their private purposes.
  87. >Standard UNIX is very unreliable in (usually NOT) allowing one to
  88. >address the full 8-bit ascii char set except for minor instances
  89. >of generosity, so I look to the DOS UNIX-lookalikes to solve the
  90. >problem.
  91.  
  92. Well, we have ordinary text file reads here.  In DOS there's very little
  93. processing that occurs during text file reads .. just EOL and EOF mainly.
  94. I scanned sed11's source and found nothing to indicate text characters are
  95. being tampered for their 8th bit.
  96.  
  97. Unfortunately, this is *not* "raw" mode in its crudest form, so you will
  98. NOT be able to get *all* the control characters.  But sed was, after all,
  99. from the beginning intended to deal with TEXT.  And you wish to step
  100. outside those boundaries.
  101.  
  102. >Questions:
  103. >
  104. >1) are decimal 10 and 13 the ONLY chars that can be addressed with "sed11"
  105. >   using the convention \d13  ?
  106.  
  107. Donno .. I'm not familiar enough with sed and its command files to
  108. experiment.  It *looks* like any character could be used.  But where'd you
  109. get that "\dxx" business?  I didn't see anything like that in the source,
  110. and the man says just to use "\xx".
  111.  
  112. >2) otherwise, will "sed11" faithfully handle all 256 chars, if they are
  113. >   in scripts and text files?
  114.  
  115. It looks like it, except for ^Z (ASCII 26) and CR/LFs.
  116.  
  117. >3) is it not reasonable to think of pushing the buffer size beyond
  118. >   4K (e.g., for the purpose of using tags in the pattern space)?  The
  119. >   major drawback of these utils is that they choke on long lines --
  120. >   I am thinking of SGML files, for instance.  Do you know of any
  121. >   attempts (for 386 machines) to build grep/sed/awk to handle
  122. >   LONG lines - approaching 32K, or more?
  123.  
  124. I tried, bumping the buffers up to 24K (needed malloc() to do that too).
  125. It seemed to run just fine, but then choked&died on loooooong lines (about
  126. 14Kb).  Don't know why, and don't plan to spend the time finding out!
  127. Again, you're wandering beyond text files .. and there's no warrant for
  128. sed to do things like that.
  129.  
  130. Sorry I can't be more help, but I am *not* a bonafide sed writer or
  131. developer.  I only did a hack to port it to Turbo C v2.0, and have no
  132. plans to enhance or modify sed in any other way.
  133.  
  134. David Kirschbaum
  135. Toad Hall
  136. kirsch@usasoc.soc.mil
  137. 
  138. 
  139. Return-Path: <bsu-cs!mdlawler@iuvax.cs.indiana.edu>
  140. Date: Sun, 23 Jun 91 16:08:09 -0500
  141. From: mdlawler@bsu-cs.bsu.edu (Michael D. Lawler)
  142. Message-Id: <9106232108.AA01077@bsu-cs.bsu.edu>
  143. To: kirsch@usasoc.soc.mil
  144. Subject: sed
  145.  
  146. Here are the messages from Borland C++ 2.0 on the sed that you just put on
  147. simtel.  Do I need to worry about any of them and if so and you make diffs
  148. will you please send them to me?  Also can sed be a com file or do you know?
  149. Borland C++  Version 2.0 Copyright (c) 1991 Borland International
  150. sedcomp.c:
  151. Warning sedcomp.c 221: Function should return a value in function main
  152. Warning sedcomp.c 761: Function should return a value in function gettext
  153. Warning sedcomp.c 831: Constant out of range in comparison in function ycomp
  154. sedexec.c:
  155. Warning sedexec.c 256: Function should return a value in function selected
  156. Warning sedexec.c 472: Possibly incorrect assignment in function dosub
  157. Turbo Link  Version 4.0 Copyright (c) 1991 Borland International
  158.         Available memory 155200
  159.  
  160. 
  161. 
  162. Return-Path: <bsu-cs!mdlawler@iuvax.cs.indiana.edu>
  163. Date: Sun, 23 Jun 91 19:21:30 -0500
  164. From: mdlawler@bsu-cs.bsu.edu (Michael D. Lawler)
  165. Message-Id: <9106240021.AA03140@bsu-cs.bsu.edu>
  166. To: kirsch@usasoc.soc.mil
  167. Subject: another sed question
  168.  
  169. Assuming that I have both cat and uudecode how do I get this script to work
  170. with the sed that you just uploaded to simtel?
  171. #! /bin/sh
  172. cat $* | sed '/^END/,/^BEGIN/d'| uudecode
  173.  
  174. 
  175. 
  176. Date:     Mon, 24 Jun 91 13:42:09 EDT
  177. From:     David Kirschbaum
  178. To:       mdlawler@bsu-cs.bsu.edu (Michael D. Lawler)
  179. Subject:  Re:  sed
  180.  
  181. >Here are the messages from Borland C++ 2.0 on the sed that you just put on
  182. >simtel.  Do I need to worry about any of them and if so and you make diffs
  183. >will you please send them to me?  Also can sed be a com file or do you know?
  184.  
  185. Well, the C++ complaints look *almost* like my TC 2.0 ones ...
  186.  
  187. >sedcomp.c:
  188. >Warning sedcomp.c 221: Function should return a value in function main
  189.  
  190. Yeah, yeah, it wants a "return(0)" to keep from bitching.  The function
  191. exits with other values B